package com.project.bean;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 销售订单明细实体类
 */
@Data
@NoArgsConstructor
@TableName("t_saleorderinfo")
public class SaleOrderInfoBean {
    @TableId(value = "pk_saleOrderInfoId",type = IdType.AUTO)
    /**销售订单详情id*/
    private Integer id;

    @TableField("fk_saleOrderId")
    /**销售订单id*/
    private Integer saleOrderId;
    @TableField(exist = false)
    /**销售订单*/
    private SaleOrderBean saleOrder;

    @TableField("fk_productId")
    /**商品id*/
    private Integer productId;
    @TableField(exist = false)
    /**商品*/
    private ProductBean product;

    @TableField("soi_price")
    /**成交价*/
    private Integer price;
    @TableField("soi_num")
    /**销售数量*/
    private Integer num;


    public SaleOrderInfoBean(Integer saleOrderId, Integer productId, Integer price, Integer num) {
        this.saleOrderId = saleOrderId;
        this.productId = productId;
        this.price = price;
        this.num = num;
    }

    @Override
    public String toString() {
        return "SaleOrderInfoBean{" +
                "id=" + id +
                ", saleOrderId=" + saleOrderId +
                ", saleOrder=" + saleOrder +
                ", productId=" + productId +
                ", product=" + product +
                ", price=" + price +
                ", num=" + num +
                "}\n";
    }
}
